﻿<?php
    @session_start();

     if (isset($_SESSION['id']))
    {
        header('location:list_article.php');
    }
?>
<!DOCTYPE html>
<html>
	<head>
		<title>Gestion de stock</title>
		<!-- Bootstrap -->
		<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
		<link href="bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
		<link href="vendors/styles.css" rel="stylesheet" media="screen">
		<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
		<!--[if lt IE 9]>
		<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
		<![endif]-->
		<script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
	</head>
	<body id="login">
		<div class="container">

			<form class="form-signin" action="submit/submit_login.php" id="formID" method="POST">

		<?php
			if ((isset($_GET["action"])) && ($_GET["action"] == "incorrect_password")) {
			echo '
              <div class="alert alert-error">
              	Mot de passe incorrecte <button type="button" class="close" data-dismiss="alert">&times;</button>
              </div>';
			}
			if ((isset($_GET["action"])) && ($_GET["action"] == "incorrect_email")) {
			echo '
              <div class="alert alert-error">
              	Mot de passe incorrecte <button type="button" class="close" data-dismiss="alert">&times;</button>
              </div>';
			}
			if ((isset($_GET["action"])) && ($_GET["action"] == "incorrect_login")) {
			echo '
              <div class="alert alert-error">
              	Email et Mot de passe incorrectes <button type="button" class="close" data-dismiss="alert">&times;</button>
              </div>';
			}
		?>

				<h2 class="form-signin-heading"><center>Gestion de Stock</center></h2>
				<input type="text" class="validate[required,custom[email]] input-block-level" name="email">
				<input type="password" class="validate[required] input-block-level" name="password">

				<button class="btn btn btn-primary span3" type="submit" style="margin-left:17px;margin-bottom:0px;">
					Connexion
				</button>
				<a href="submit/submit_invite.php?session=invite" class="btn btn btn-inverse" type="submit" style="margin-left: 16px; margin-top: 20px; width: 247px;">
					Session Invité
				</a>
			</form>

		</div>
		<!-- /container -->
		<script src="vendors/jquery-1.9.1.min.js"></script>
		<script src="bootstrap/js/bootstrap.min.js"></script>
		<!-- /validationEngine -->
		<link rel="stylesheet" href="assets/lib/validationengine/css/validationEngine.jquery.css">

		<script src="assets/lib/validationengine/js/jquery.validationEngine.js"></script>
		<script src="assets/lib/validationengine/js/languages/jquery.validationEngine-fr.js"></script>
		<script src="assets/lib/validation/dist/jquery.validate.min.js"></script>
		<script src="assets/lib/validation/localization/messages_ja.js"></script>

		<script>
			$(function() {
				formValidation();
			});
			$("#formID").validationEngine();
			$("#formSD").validationEngine();
			$("#formAddIntervention").validationEngine();

			function validate2fields() {
				if ($("#firstname").val() == "" || $("#lastname").val() == "") {
					return false;
				} else {
					return true;
				}
			}
		</script>

	</body>
</html>